#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e5 + 10;
struct node {
	int a, h;
}a[N];
int f[N];
bool cmp(node x, node y) {
	if(x.a != y.a) return x.a < y.a;
	return x.h < y.h;
}
int b[N], g[N], sg[N];
signed main() {
	freopen("xinyue.in", "r", stdin);
	freopen("xinyue.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, cnt = 0;
	cin >> n >> a[0].a;
	int Max = a[0].a;
	for(int i = 1; i <= n; i++) cin >> a[i].a >> a[i].h, Max = max(Max, a[i].a); 
	
	memset(f, 0x7f, sizeof(f));
	f[0] = 0;
	sort(a + 1, a + n + 1, cmp);
	for(int i = 1; i <= n; i++) {
		sg[i] = sg[i - 1] + (((a[i].h + Max - 1) / Max) - 1) * a[i].a;
		for(int j = 0; j < i; j++) {
			int p = f[j] + (((a[i].h + a[j].a - 1) / a[j].a) - 1) * a[i].a + sg[i - 1] - sg[j];
			f[i] = min(f[i], p);
		}
		cout << f[i] << endl;
	}
	cout << f[n];
	return 0;
}
/*

*/

